package StringBuilder;

public class StringBuildIntroduce {
    public static void main(String[] args) {

        /*
        * 一个可变的字符串序列
        * StringBuilder 是字符串的缓冲区 : 可以理解为容器, 可以存储任意数据类型, 只要进入容器,就变成字符串
        * */

//        aaaa();
//        StringBuilder sb =   new StringBuilder(); // 初始容量是16个字符
//        sb.append("1234567890123456789");
//        System.out.println(sb);
        StringBuilder sb  = new StringBuilder();
        StringBuilder eee = sb.append("红色蓝色绿色");
        String string = eee.toString();
        String[] split = string.split("色");
        for (int i = 0; i < split.length; i++) {
            System.out.println(split[i]);
        }

    }


    private static void aaaa() {
        StringBuilder sb=   new StringBuilder();
        sb.append("");
        sb.append(100);
        sb.append('中');
        sb.append(45.6);
        sb.append(false);
        sb.append("黑马程序员");
        System.out.println(sb);
    }
}
